<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    request.setCharacterEncoding("utf-8");
    response.setContentType("text/html;charset=utf-8");
    PrintWriter o = response.getWriter();
    session.setAttribute("count", null);
    if (session.getAttribute("user") == null) {
        o.print("<script>alert('未登录，请先登录!');window.location.href='admin.jsp'</script>");
    }
%>
<html lang="en" class="no-js">
<head>
    <meta charset="utf-8">
    <title>个人标签后台主页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- CSS -->
    <link rel="stylesheet" href="static/assets/css/reset.css">
    <link rel="stylesheet" href="static/assets/css/supersized.css">
    <link rel="stylesheet" href="static/assets/css/home.css">
</head>
<body>
<div class="page-container">
    <a href="index.jsp">
        <button style="margin-bottom: 50px">回到主页面</button>
    </a>
    <h1>添加书签</h1>
    <form action="home?method=add" method="post" class="form3">
        <input type="text" name="name" class="name" placeholder="书签名(1-5位)">
        <input type="text" name="path" class="path" placeholder="书签链接">
        <c:forEach items="${imagesList}" varStatus="i" var="item">
        <span>
            <img style="margin:20px 0 20px 20px;" height="64" width="64" src="static${item.imgPath}">${item.id}
        </span>
        </c:forEach>
        <input type="text" name="id" class="id" placeholder="书签样式">
        <button type="submit">确定添加</button>
        <div class="error"><span>+</span></div>
    </form>
    <div class="connect">
        <p>作者：KK</p>
    </div>
</div>
<form action="home?method=list" method="post" name="form1"></form>
<div style="display: none" id="count" title="1${imagesCount}">
</div>
<script language=javascript>
    let count = document.getElementById("count").title
    if (count == '1') {
        setTimeout("document.form1.submit()", 100)
    }
</script>
<!-- Javascript -->
<script src="static/assets/js/jquery-1.8.2.min.js"></script>
<script src="static/assets/js/supersized.3.2.7.min.js"></script>
<script src="static/assets/js/supersized-init.js"></script>
<script src="static/assets/js/scripts.js"></script>
</body>
</html>
